<?php

namespace App\Console\Commands;

use App\Http\Services\SendGiftServices;
use Carbon\Carbon;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;

class LuckGiftBatchHandle extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'LuckGiftBatchHandle';

    protected $sendGiftServices;


    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '幸运礼物批量处理';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
        $this->sendGiftServices = new SendGiftServices();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        ini_set('memory_limit', '-1');
        do{
            $this->sendGiftServices->batchNewLuckGiftHandle();
        }while(true);
    }
}